🎖️GitЯра🎖️
Node / meshtastic / Meshtastic-Android / files / androidApp / src / google / kotlin / org / meshtastic / app / map / MBTilesProvider.kt
Displaying Raw • Download
androidApp/src/google/kotlin/org/meshtastic/app/map/MBTilesProvider.kt 2d20cd8a4708e2ef66e98d5259f3a97ec93f240a (2d20cd8a) Text, 2.06 KB
T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.map
Tff7b72import T7ee787android.database.sqlite.SQLiteDatabase
Tff7b72import T7ee787com.google.android.gms.maps.model.Tile
Tff7b72import T7ee787com.google.android.gms.maps.model.TileProvider
Tff7b72import T7ee787java.io.File
Tff7b72class T56d364MBTilesProviderTb4b4b4(Tff7b72private Tff7b72val Te6edf3fileTb4b4b4: Te6edf3FileTb4b4b4) Tb4b4b4:
Te6edf3TileProviderTb4b4b4,
Te6edf3AutoCloseable Tb4b4b4{
Tff7b72private Tff7b72var Te6edf3databaseTb4b4b4: Te6edf3SQLiteDatabase? Tff7b72= Tff7b72null
Tff7b72init Tb4b4b4{
Te6edf3openDatabaseTb4b4b4(Tb4b4b4)
Tb4b4b4}
Tff7b72private Tff7b72fun Td2a8ffopenDatabaseTb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72if Tb4b4b4(Te6edf3database Tff7b72=Tff7b72= Tff7b72null Tff7b72&Tff7b72& Te6edf3fileTb4b4b4.Te6edf3existsTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{
Te6edf3database Tff7b72= Te6edf3SQLiteDatabaseTb4b4b4.Te6edf3openDatabaseTb4b4b4(Te6edf3fileTb4b4b4.Te6edf3absolutePathTb4b4b4, Tff7b72nullTb4b4b4, Te6edf3SQLiteDatabaseTb4b4b4.Te6edf3OPEN_READONLYTb4b4b4)
Tb4b4b4}
Tb4b4b4}
Tff7b72override Tff7b72fun Td2a8ffgetTileTb4b4b4(Te6edf3xTb4b4b4: Tffa657IntTb4b4b4, Te6edf3yTb4b4b4: Tffa657IntTb4b4b4, Te6edf3zoomTb4b4b4: Tffa657IntTb4b4b4)Tb4b4b4: Te6edf3Tile? Tb4b4b4{
Tff7b72val Te6edf3db Tff7b72= Te6edf3database Tff7b72?: Tff7b72return Tff7b72null
Tff7b72var Te6edf3tileTb4b4b4: Te6edf3Tile? Tff7b72= Tff7b72null
T8b949e// Convert Google Maps y coordinate to standard TMS y coordinate
Tff7b72val Te6edf3tmsY Tff7b72= Tb4b4b4(T79c0ff1 Te6edf3shl Te6edf3zoomTb4b4b4) Tff7b72- T79c0ff1 Tff7b72- Te6edf3y
Tff7b72val Te6edf3cursor Tff7b72=
Te6edf3dbTb4b4b4.Te6edf3rawQueryTb4b4b4(
Ta5d6ff"Ta5d6ffSELECT tile_data FROM tiles WHERE zoom_level = ? AND tile_column = ? AND tile_row = ?Ta5d6ff"Tb4b4b4,
Te6edf3arrayOfTb4b4b4(Te6edf3zoomTb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3xTb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)Tb4b4b4, Te6edf3tmsYTb4b4b4.Te6edf3toStringTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4,
Tb4b4b4)
Tff7b72if Tb4b4b4(Te6edf3cursorTb4b4b4.Te6edf3moveToFirstTb4b4b4(Tb4b4b4)Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3tileData Tff7b72= Te6edf3cursorTb4b4b4.Te6edf3getBlobTb4b4b4(T79c0ff0Tb4b4b4)
Te6edf3tile Tff7b72= Te6edf3TileTb4b4b4(T79c0ff2T79c0ff5T79c0ff6Tb4b4b4, T79c0ff2T79c0ff5T79c0ff6Tb4b4b4, Te6edf3tileDataTb4b4b4)
Tb4b4b4}
Te6edf3cursorTb4b4b4.Te6edf3closeTb4b4b4(Tb4b4b4)
Tff7b72return Te6edf3tile Tff7b72?: Te6edf3TileProviderTb4b4b4.Te6edf3NO_TILE
Tb4b4b4}
Tff7b72override Tff7b72fun Td2a8ffcloseTb4b4b4(Tb4b4b4) Tb4b4b4{
Te6edf3databaseTff7b72?.Te6edf3closeTb4b4b4(Tb4b4b4)
Te6edf3database Tff7b72= Tff7b72null
Tb4b4b4}
Tb4b4b4}
Served by rngit 1.5.0 - Generated in 0.04s